import { useCache } from '@/utils/useCache'

const { wsCache } = useCache()

const accessTokenKey = 'ACCESS_TOKEN'

export const getAccessToken = () => {
  return wsCache.get(accessTokenKey) ? wsCache.get(accessTokenKey) : wsCache.get('ACCESS_TOKEN')
}

export const setAccessToken = (token: string) => {
  wsCache.set(accessTokenKey, token)
}

export const deleteAccessToken = () => {
  wsCache.delete(accessTokenKey)
}
